package net;

import java.net.InetAddress;

public class NetTest {
    public static void main(String[] args) {
        try{
            InetAddress localAddress = InetAddress.getLocalHost();
            System.out.println("本机ip地址:"+localAddress.getHostAddress());

            InetAddress remoteAddress = InetAddress.getByName("www.jju.edu.cn");
            System.out.println("jjxy:"+remoteAddress.getHostAddress());
        }catch(Exception e){
            e.printStackTrace();
        }

    }
}
